<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Aria: ArKeyHandler Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Aria
   &#160;<span id="projectnumber">2.9.4</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classArKeyHandler.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="classArKeyHandler-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">ArKeyHandler Class Reference<div class="ingroups"><a class="el" href="group__OptionalClasses.html">Optional Classes</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Perform actions when keyboard keys are pressed.  
 <a href="classArKeyHandler.html#details">More...</a></p>

<p><code>#include &lt;ArKeyHandler.h&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a665246cd772590dd02ea299dd047899c"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899c">KEY</a> { <br />
&#160;&#160;<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899ca8a1d3905f01b5d27603bb0528912d341">UP</a> = 256, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899cab3ecf95789d8f87444856e278393b4d9">DOWN</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899ca4484301bbabab1fb37e72cbcd6e3e45b">LEFT</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899ca220c952e7e336650ee7b3e0905971ede">RIGHT</a>, 
<br />
&#160;&#160;<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899caf500b147c6b180dfe6fd5acc1a659d96">ESCAPE</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899cac7e8d225519fc03645b49532ad11c880">SPACE</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899ca841794093996bdd868fedc6d4dab5c45">TAB</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899cafca668b99557b70aaf5158548f595aa6">ENTER</a>, 
<br />
&#160;&#160;<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899cae503188bb32cb6368e77b697539ad10d">BACKSPACE</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899ca052b1c08c8fc21d45627e4964df148f0">_StartFKeys</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899ca3524a3609d85cc5f23b8bd85bbac7974">F1</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899ca754f64866cda57ce482e6a93f3a1ef2a">F2</a>, 
<br />
&#160;&#160;<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899cad90da2586653c613dc6d483104b88454">F3</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899cafc936ce14eabbaaa14692748dbee508a">F4</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899ca230feb09acf4dd8295df37104e42c113">F5</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899ca930b46a66189e28129055014be0d6795">F6</a>, 
<br />
&#160;&#160;<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899caf7cc48de182fc7b1fbf493fcdcd881b9">F7</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899cae6a337c7678c79cf3fe5d89efd397652">F8</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899ca4532357da119c9899c53adc024c17efa">F9</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899cabd801629e5e7e0b151373f4ad21faec8">F10</a>, 
<br />
&#160;&#160;<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899ca1d08fc2aaa7ae7c8d0684d40c3670e86">F11</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899ca02be0576d8fab229a5d3985cdd2d85e5">F12</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899cadf8ed308714c26f9ea3bbe4f9588c478">_EndFKeys</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899ca0a916e5fd9baf9ed01442a1e0d996f9c">PAGEUP</a>, 
<br />
&#160;&#160;<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899caabbedf3b93d1e2a1f09298be2dbeca30">PAGEDOWN</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899caeaab834e0a22f88aba4d585941520f87">HOME</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899ca2e64c6f146b0a0f4d8c20af96e4fc864">END</a>, 
<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899ca2716e1f59e1fa62141a1e309a16e9543">INSERT</a>, 
<br />
&#160;&#160;<a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899ca78ad2a1dfb1c5e33c5486e64ce158330">DEL</a>
<br />
 }<tr class="memdesc:a665246cd772590dd02ea299dd047899c"><td class="mdescLeft">&#160;</td><td class="mdescRight">These are symbols for the non-ascii keys.  <a href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899c">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:a665246cd772590dd02ea299dd047899c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad5442ebb21cd242ab168e94686e06759"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArKeyHandler.html#ad5442ebb21cd242ab168e94686e06759">addKeyHandler</a> (int keyToHandle, <a class="el" href="classArFunctor.html">ArFunctor</a> *functor)</td></tr>
<tr class="memdesc:ad5442ebb21cd242ab168e94686e06759"><td class="mdescLeft">&#160;</td><td class="mdescRight">This adds a keyhandler, when the keyToHandle is hit, functor will fire.  <a href="#ad5442ebb21cd242ab168e94686e06759">More...</a><br /></td></tr>
<tr class="separator:ad5442ebb21cd242ab168e94686e06759"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f60d37adaeb8d285a861afed2f38250"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArKeyHandler.html#a8f60d37adaeb8d285a861afed2f38250">ArKeyHandler</a> (bool blocking=false, bool addAriaExitCB=true, FILE *stream=NULL, bool takeKeysInConstructor=true)</td></tr>
<tr class="memdesc:a8f60d37adaeb8d285a861afed2f38250"><td class="mdescLeft">&#160;</td><td class="mdescRight">This object will take over key capture when constructed, and release key capture when destroyed.  <a href="#a8f60d37adaeb8d285a861afed2f38250">More...</a><br /></td></tr>
<tr class="separator:a8f60d37adaeb8d285a861afed2f38250"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8b2b9cdf792f36ca199efe5a7109bc73"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArKeyHandler.html#a8b2b9cdf792f36ca199efe5a7109bc73">checkKeys</a> (void)</td></tr>
<tr class="memdesc:a8b2b9cdf792f36ca199efe5a7109bc73"><td class="mdescLeft">&#160;</td><td class="mdescRight">Internal: Use <a class="el" href="classArKeyHandler.html#ad5442ebb21cd242ab168e94686e06759" title="This adds a keyhandler, when the keyToHandle is hit, functor will fire. ">addKeyHandler()</a> instead.  <a href="#a8b2b9cdf792f36ca199efe5a7109bc73">More...</a><br /></td></tr>
<tr class="separator:a8b2b9cdf792f36ca199efe5a7109bc73"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1eaee34475ddaae26c5800f53eb9e451"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArKeyHandler.html#a1eaee34475ddaae26c5800f53eb9e451">getKey</a> (void)</td></tr>
<tr class="memdesc:a1eaee34475ddaae26c5800f53eb9e451"><td class="mdescLeft">&#160;</td><td class="mdescRight">internal, use addKeyHandler instead...  <a href="#a1eaee34475ddaae26c5800f53eb9e451">More...</a><br /></td></tr>
<tr class="separator:a1eaee34475ddaae26c5800f53eb9e451"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e742bc0a0d071657d4cc1286b07c3ca"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArKeyHandler.html#a6e742bc0a0d071657d4cc1286b07c3ca">remKeyHandler</a> (int keyToHandler)</td></tr>
<tr class="memdesc:a6e742bc0a0d071657d4cc1286b07c3ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">This removes a key handler, by key.  <a href="#a6e742bc0a0d071657d4cc1286b07c3ca">More...</a><br /></td></tr>
<tr class="separator:a6e742bc0a0d071657d4cc1286b07c3ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a293b845bb47ee8b9a4cadf96e95eb335"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArKeyHandler.html#a293b845bb47ee8b9a4cadf96e95eb335">remKeyHandler</a> (<a class="el" href="classArFunctor.html">ArFunctor</a> *functor)</td></tr>
<tr class="memdesc:a293b845bb47ee8b9a4cadf96e95eb335"><td class="mdescLeft">&#160;</td><td class="mdescRight">This removes a key handler, by key.  <a href="#a293b845bb47ee8b9a4cadf96e95eb335">More...</a><br /></td></tr>
<tr class="separator:a293b845bb47ee8b9a4cadf96e95eb335"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae75d46abeb802d1edac99400d387c404"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArKeyHandler.html#ae75d46abeb802d1edac99400d387c404">restore</a> (void)</td></tr>
<tr class="memdesc:ae75d46abeb802d1edac99400d387c404"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets stdin back to its original settings, if its been restored it won't read anymore.  <a href="#ae75d46abeb802d1edac99400d387c404">More...</a><br /></td></tr>
<tr class="separator:ae75d46abeb802d1edac99400d387c404"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a82fcfaf189ace57adcba70de4dc6982e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArKeyHandler.html#a82fcfaf189ace57adcba70de4dc6982e">takeKeys</a> (bool blocking=false)</td></tr>
<tr class="memdesc:a82fcfaf189ace57adcba70de4dc6982e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Takes the key control over.  <a href="#a82fcfaf189ace57adcba70de4dc6982e">More...</a><br /></td></tr>
<tr class="separator:a82fcfaf189ace57adcba70de4dc6982e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d10a504c35c990c4717026f0ed700ae"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArKeyHandler.html#a5d10a504c35c990c4717026f0ed700ae">~ArKeyHandler</a> ()</td></tr>
<tr class="memdesc:a5d10a504c35c990c4717026f0ed700ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="#a5d10a504c35c990c4717026f0ed700ae">More...</a><br /></td></tr>
<tr class="separator:a5d10a504c35c990c4717026f0ed700ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a5bb532a67701961152587eb27fc17a10"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5bb532a67701961152587eb27fc17a10"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>getChar</b> (void)</td></tr>
<tr class="separator:a5bb532a67701961152587eb27fc17a10"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:ae5281c63e8c680fdbd898d8feef63c69"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae5281c63e8c680fdbd898d8feef63c69"></a>
<a class="el" href="classArFunctorC.html">ArFunctorC</a>&lt; <a class="el" href="classArKeyHandler.html">ArKeyHandler</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>myAriaExitCB</b></td></tr>
<tr class="separator:ae5281c63e8c680fdbd898d8feef63c69"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3f02d7c9a8d5f72db2b2af250167c414"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3f02d7c9a8d5f72db2b2af250167c414"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>myBlocking</b></td></tr>
<tr class="separator:a3f02d7c9a8d5f72db2b2af250167c414"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8d7c3353a25b047c26baeaffe431dae7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8d7c3353a25b047c26baeaffe431dae7"></a>
std::map&lt; int, <a class="el" href="classArFunctor.html">ArFunctor</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>myMap</b></td></tr>
<tr class="separator:a8d7c3353a25b047c26baeaffe431dae7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3dd1e60f20f673bef8c4e688acc79955"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3dd1e60f20f673bef8c4e688acc79955"></a>
struct termios&#160;</td><td class="memItemRight" valign="bottom"><b>myOriginalTermios</b></td></tr>
<tr class="separator:a3dd1e60f20f673bef8c4e688acc79955"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a223bba4ccf37ea7235896e1e91a79779"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a223bba4ccf37ea7235896e1e91a79779"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>myRestored</b></td></tr>
<tr class="separator:a223bba4ccf37ea7235896e1e91a79779"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f57c5bf5239032d809df3ab965c6135"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0f57c5bf5239032d809df3ab965c6135"></a>
FILE *&#160;</td><td class="memItemRight" valign="bottom"><b>myStream</b></td></tr>
<tr class="separator:a0f57c5bf5239032d809df3ab965c6135"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a618924c00cc682e09a6e38ca34e404ec"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a618924c00cc682e09a6e38ca34e404ec"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>myTookKeys</b></td></tr>
<tr class="separator:a618924c00cc682e09a6e38ca34e404ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Perform actions when keyboard keys are pressed. </p>
<p>This class is used for handling input from the keyboard. Use <a class="el" href="classArKeyHandler.html#ad5442ebb21cd242ab168e94686e06759" title="This adds a keyhandler, when the keyToHandle is hit, functor will fire. ">addKeyHandler()</a> to associate a functor with a keyboard key. <a class="el" href="classArKeyHandler.html" title="Perform actions when keyboard keys are pressed. ">ArKeyHandler</a> will call that functor when the key is pressed.</p>
<p>You should also register the keyhandler with <a class="el" href="classAria.html#a9e5496a4ec2c379c8e18706922b57cc1" title="Sets the key handler, so that other classes can find it using getKeyHandler() ">Aria::setKeyHandler()</a>, and before you create a key handler you should see if one is already there with <a class="el" href="classAria.html#a5b8042b38b19d6a5d3cfbed4df483e67" title="Gets a pointer to the global key handler, if one has been set with setKeyHandler() ...">Aria::getKeyHandler()</a>. Only one key handler can be created in a program, and this lets independent parts of a program use the same key handler.</p>
<p>You can attach a key handler to a robot with <a class="el" href="classArRobot.html#ab4ea516667d2358f35b435d97b616ab1" title="Attachs a key handler. ">ArRobot::attachKeyHandler()</a> which will put a task into the robots list of tasks to check for new keyboard input in each cycle, and which will also add a handler to end the robot's task cycle when Escape is pressed (you can override this by replacing it with your own handler). If you have mulitple <a class="el" href="classArRobot.html" title="Central class for communicating with and operating the robot. ">ArRobot</a> objects, only create one key handler and attach it to one robot.</p>
<p>Alternatively, you can call <a class="el" href="classArKeyHandler.html#a8b2b9cdf792f36ca199efe5a7109bc73" title="Internal: Use addKeyHandler() instead. ">checkKeys()</a> periodically to check for new key input. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="actionGroupExample_8cpp-example.html#_a26">actionGroupExample.cpp</a>, <a class="el" href="actsColorFollowingExample_8cpp-example.html#_a34">actsColorFollowingExample.cpp</a>, <a class="el" href="demo_8cpp-example.html#_a23">demo.cpp</a>, <a class="el" href="dpptuExample_8cpp-example.html#_a9">dpptuExample.cpp</a>, <a class="el" href="gripperExample_8cpp-example.html#_a6">gripperExample.cpp</a>, <a class="el" href="gyroExample_8cpp-example.html#_a5">gyroExample.cpp</a>, <a class="el" href="imuExample_8cpp-example.html#_a14">imuExample.cpp</a>, <a class="el" href="lineFinderExample_8cpp-example.html#_a16">lineFinderExample.cpp</a>, <a class="el" href="triangleDriveToActionExample_8cpp-example.html#_a15">triangleDriveToActionExample.cpp</a>, and <a class="el" href="wander_8cpp-example.html#_a13">wander.cpp</a>.</dd>
</dl></div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a class="anchor" id="a665246cd772590dd02ea299dd047899c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classArKeyHandler.html#a665246cd772590dd02ea299dd047899c">ArKeyHandler::KEY</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>These are symbols for the non-ascii keys. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899ca8a1d3905f01b5d27603bb0528912d341"></a>UP&#160;</td><td class="fielddoc">
<p>Up arrow (keypad or 4 key dirs) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899cab3ecf95789d8f87444856e278393b4d9"></a>DOWN&#160;</td><td class="fielddoc">
<p>Down arrow (keypad or 4 key dirs) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899ca4484301bbabab1fb37e72cbcd6e3e45b"></a>LEFT&#160;</td><td class="fielddoc">
<p>Left arrow (keypad or 4 key dirs) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899ca220c952e7e336650ee7b3e0905971ede"></a>RIGHT&#160;</td><td class="fielddoc">
<p>Right arrow (keypad or 4 key dirs) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899caf500b147c6b180dfe6fd5acc1a659d96"></a>ESCAPE&#160;</td><td class="fielddoc">
<p>Escape key. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899cac7e8d225519fc03645b49532ad11c880"></a>SPACE&#160;</td><td class="fielddoc">
<p>Space key. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899ca841794093996bdd868fedc6d4dab5c45"></a>TAB&#160;</td><td class="fielddoc">
<p>Tab key. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899cafca668b99557b70aaf5158548f595aa6"></a>ENTER&#160;</td><td class="fielddoc">
<p>Enter key. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899cae503188bb32cb6368e77b697539ad10d"></a>BACKSPACE&#160;</td><td class="fielddoc">
<p>Backspace key. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899ca052b1c08c8fc21d45627e4964df148f0"></a>_StartFKeys&#160;</td><td class="fielddoc">
<p>F key offset (internal; don't use). </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899ca3524a3609d85cc5f23b8bd85bbac7974"></a>F1&#160;</td><td class="fielddoc">
<p>F1. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899ca754f64866cda57ce482e6a93f3a1ef2a"></a>F2&#160;</td><td class="fielddoc">
<p>F2. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899cad90da2586653c613dc6d483104b88454"></a>F3&#160;</td><td class="fielddoc">
<p>F3. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899cafc936ce14eabbaaa14692748dbee508a"></a>F4&#160;</td><td class="fielddoc">
<p>F4. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899ca230feb09acf4dd8295df37104e42c113"></a>F5&#160;</td><td class="fielddoc">
<p>F5 (not supported on Windows yet) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899ca930b46a66189e28129055014be0d6795"></a>F6&#160;</td><td class="fielddoc">
<p>F6 (not supported on Windows yet) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899caf7cc48de182fc7b1fbf493fcdcd881b9"></a>F7&#160;</td><td class="fielddoc">
<p>F7 (not supported on Windows yet) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899cae6a337c7678c79cf3fe5d89efd397652"></a>F8&#160;</td><td class="fielddoc">
<p>F8 (not supported on Windows yet) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899ca4532357da119c9899c53adc024c17efa"></a>F9&#160;</td><td class="fielddoc">
<p>F9 (not supported on Windows yet) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899cabd801629e5e7e0b151373f4ad21faec8"></a>F10&#160;</td><td class="fielddoc">
<p>F10 (not supported on Windows yet) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899ca1d08fc2aaa7ae7c8d0684d40c3670e86"></a>F11&#160;</td><td class="fielddoc">
<p>F11 (not supported on Windows yet) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899ca02be0576d8fab229a5d3985cdd2d85e5"></a>F12&#160;</td><td class="fielddoc">
<p>F12 (not supported on Windows yet) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899cadf8ed308714c26f9ea3bbe4f9588c478"></a>_EndFKeys&#160;</td><td class="fielddoc">
<p>F key range (internal; don't use) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899ca0a916e5fd9baf9ed01442a1e0d996f9c"></a>PAGEUP&#160;</td><td class="fielddoc">
<p>Page Up (not supported on Windows yet) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899caabbedf3b93d1e2a1f09298be2dbeca30"></a>PAGEDOWN&#160;</td><td class="fielddoc">
<p>Page Down (not supported on Windows yet) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899caeaab834e0a22f88aba4d585941520f87"></a>HOME&#160;</td><td class="fielddoc">
<p>Home key (not supported on Windows yet) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899ca2e64c6f146b0a0f4d8c20af96e4fc864"></a>END&#160;</td><td class="fielddoc">
<p>End key (not supported on Windows yet) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899ca2716e1f59e1fa62141a1e309a16e9543"></a>INSERT&#160;</td><td class="fielddoc">
<p>Insert key (not supported on Windows yet) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="a665246cd772590dd02ea299dd047899ca78ad2a1dfb1c5e33c5486e64ce158330"></a>DEL&#160;</td><td class="fielddoc">
<p>Special delete key (often forward-delete) (not supported on Windows yet) </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a8f60d37adaeb8d285a861afed2f38250"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ArKeyHandler::ArKeyHandler </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>blocking</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>addAriaExitCB</em> = <code>true</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">FILE *&#160;</td>
          <td class="paramname"><em>stream</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>takeKeysInConstructor</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This object will take over key capture when constructed, and release key capture when destroyed. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">blocking</td><td>whether or not to block waiting on keys, default is false, ie not to wait... you probably only want to block if you are using checkKeys yourself like after you start a robot run or in its own thread or something along those lines </td></tr>
    <tr><td class="paramname">addAriaExitCB</td><td>true to add an aria exit cb to restore the keys </td></tr>
    <tr><td class="paramname">stream</td><td>the FILE * pointer to use, if this is NULL (the default) then use stdin, otherwise use this... </td></tr>
    <tr><td class="paramname">takeKeysInConstructor</td><td>whether to take the keys when created or not (default is true) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a5d10a504c35c990c4717026f0ed700ae"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ArKeyHandler::~ArKeyHandler </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destructor. </p>
<p>Reseases control of the keyboard and restores state before this key handler was created. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ad5442ebb21cd242ab168e94686e06759"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ArKeyHandler::addKeyHandler </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>keyToHandle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classArFunctor.html">ArFunctor</a> *&#160;</td>
          <td class="paramname"><em>functor</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This adds a keyhandler, when the keyToHandle is hit, functor will fire. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">keyToHandle</td><td>A character value, such as 'a' or '1' or '[', or a member of the KEY enum.</td></tr>
    <tr><td class="paramname">functor</td><td>Functor to call when <em>keyToHandle</em> is received</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true If no previous key handler functor exists for <em>keyToHandle</em> and the handler functor was stored, or false if a handler for that key already exists. that key </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="actionGroupExample_8cpp-example.html#a31">actionGroupExample.cpp</a>, <a class="el" href="actsColorFollowingExample_8cpp-example.html#a40">actsColorFollowingExample.cpp</a>, <a class="el" href="dpptuExample_8cpp-example.html#a13">dpptuExample.cpp</a>, <a class="el" href="gripperExample_8cpp-example.html#a10">gripperExample.cpp</a>, <a class="el" href="gyroExample_8cpp-example.html#a13">gyroExample.cpp</a>, <a class="el" href="lineFinderExample_8cpp-example.html#a25">lineFinderExample.cpp</a>, and <a class="el" href="triangleDriveToActionExample_8cpp-example.html#a20">triangleDriveToActionExample.cpp</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a8b2b9cdf792f36ca199efe5a7109bc73"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ArKeyHandler::checkKeys </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Internal: Use <a class="el" href="classArKeyHandler.html#ad5442ebb21cd242ab168e94686e06759" title="This adds a keyhandler, when the keyToHandle is hit, functor will fire. ">addKeyHandler()</a> instead. </p>
<p>This internal method Checks for keys and handles them. This is automatically done in an <a class="el" href="classArRobot.html" title="Central class for communicating with and operating the robot. ">ArRobot</a> task if a keyhandler attached to <a class="el" href="classArRobot.html" title="Central class for communicating with and operating the robot. ">ArRobot</a> with <a class="el" href="classArRobot.html#ab4ea516667d2358f35b435d97b616ab1" title="Attachs a key handler. ">ArRobot::attachKeyHandler()</a> or <a class="el" href="classAria.html#a9e5496a4ec2c379c8e18706922b57cc1" title="Sets the key handler, so that other classes can find it using getKeyHandler() ">Aria::setKeyHandler()</a>, in which case you do not need to call it. If not using or running an <a class="el" href="classArRobot.html" title="Central class for communicating with and operating the robot. ">ArRobot</a> task cycle, call this instead. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="dpptuExample_8cpp-example.html#a33">dpptuExample.cpp</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a1eaee34475ddaae26c5800f53eb9e451"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ArKeyHandler::getKey </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>internal, use addKeyHandler instead... </p>
<p>Gets a key from the stdin if ones available, -1 if there aren't any available </p>

</div>
</div>
<a class="anchor" id="a6e742bc0a0d071657d4cc1286b07c3ca"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ArKeyHandler::remKeyHandler </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>keyToHandle</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This removes a key handler, by key. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">keyToHandle</td><td>The character value or code to clear the handler for.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the remKeyHandler succeeded, which means that a key handler for <em>keyToHandle</em> was found and rmeoved, or false if no handler for that value was found. </dd></dl>

</div>
</div>
<a class="anchor" id="a293b845bb47ee8b9a4cadf96e95eb335"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ArKeyHandler::remKeyHandler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classArFunctor.html">ArFunctor</a> *&#160;</td>
          <td class="paramname"><em>functor</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This removes a key handler, by key. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">functor</td><td>the functor of the handler to remove</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the remKeyHandler succeeded, which means that the functor was found and removed from the handlers, or false if no handler with the given functor was found. </dd></dl>

</div>
</div>
<a class="anchor" id="ae75d46abeb802d1edac99400d387c404"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ArKeyHandler::restore </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets stdin back to its original settings, if its been restored it won't read anymore. </p>
<p>For internal or special use, since it's called in the destructor. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="actsColorFollowingExample_8cpp-example.html#a46">actsColorFollowingExample.cpp</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="a82fcfaf189ace57adcba70de4dc6982e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ArKeyHandler::takeKeys </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>blocking</em> = <code>false</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Takes the key control over. </p>
<p>For internal or special use, since it's called in the constructor. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>ArKeyHandler.h</li>
<li>ArKeyHandler.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="classArKeyHandler.html">ArKeyHandler</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
